<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>函数新特性</title>
</head>
<body>
    <script>

        /* 
            es5: 算元运算 
         */
         function fn1(a,b){
             b = b || 'world'
             console.log(a+ ' ' +b);
         }
         fn1('hello')

         /* 
            es6：形参默认值
          */
          function fn2(a,b = 'world'){
            console.log(a+ ' ' +b);
          }
          fn2('hello')

          /* 
            剩余参数：...
           */
           function fn3(a,...b){
               console.log(a,b);
           }
           fn3('zs','ls','ww')
    </script>
</body>
</html>